package com.icongyou.enterprise.common.dictionary;

import lombok.Getter;

@Getter
public enum GenderEnum {
    MALE(0, "男"),
    FEMALE(1, "女"),
    UNKNOWN(2, "未知");

    private final Integer value;
    private final String description;

    GenderEnum(Integer value, String description) {
        this.value = value;
        this.description = description;
    }

    public static GenderEnum getByValue(Integer value) {
        for (GenderEnum gender : GenderEnum.values()) {
            if (gender.getValue().equals(value)) {
                return gender;
            }
        }
        return null;
    }
}